package xyz.wjwnya.common.auth;

import lombok.Getter;
import org.junit.Test;

import java.util.List;

/**
 * 分页数据
 * @author zwj
 */
@Getter
public class PaginationData {
    //每页记录条数
    public int number;
    //当前页
    public int currentPage;
    //总页数
    public int sumPage;
    //总记录
    public int sum;
    //状态
    public boolean state = false;
    public PaginationData(){

    }
    public PaginationData(int number, int page,int sum){
        this.number = number;
        this.sum = sum;
        if(this.sum<=0){
           return;
        }
        this.sumPage =  sum%number == 0?sum/number:sum/number+1;
        if(!(page<=0||page>this.sumPage)){
            this.state = true;
        }
        this.currentPage = page;
    }
}
